<?php
/**
引用H5静态页
 */
namespace App\Http\Controllers\Property;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;

class HtmlController extends  Controller{

    public function explain($type){
        $data      = DB::table('goods')->where('goods_id',$type)->get();
        return view('html.explain')->with('data',$data);
    }

    public function Html(){
        return view('html.Html');
    }

    public function particulars(Request $request,$type){
        if($request ->isMethod('get')){
            $data      = DB::table('goods')->where('goods_id',$type)->get();
           return view('html.particulars')->with('data',$data);
        }
    }

    public function Hottopic(Request $request,$type){
        if($request ->isMethod('get')){
            $data      = DB::table('hottopic')->where('hottopic_id',$type)->get();
            return view('html.Hottopic')->with('data',$data);
        }
    }

    public function Mytip(Request $request,$type){
        if($request ->isMethod('get')){
            $data      = DB::table('secret')->where('secret_id',$type)->get();
            return view('html.Mytip')->with('data',$data);
        }
    }
    public function order(Request $request,$id){
        if($request ->isMethod('get')){
            $data    = DB::table('order')
                ->leftjoin('address','order.order_address','=','address.address_id')
                ->leftjoin('goods','order.order_goods_id','=','goods.goods_id')
                ->where('order',$id)
                ->first();
            return view('html.order') ->with(['data'=>$data]);
        }
    }
}